package com.inst.jsoup_html_demo.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.inst.jsoup_html_demo.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;


/**
 * Created by zhouwei on 17/4/23.
 */

public class FollowFragment extends Fragment {


    @BindView(R.id.tv_home_shouye)
    TextView mTvHomeShouye;
    @BindView(R.id.tv_home_fenye)
    TextView mTvHomeFenye;
    @BindView(R.id.tv_home_shicai)
    TextView mTvHomeShicai;
    @BindView(R.id.iv_add)
    ImageView mIvAdd;
    @BindView(R.id.tv_facaipu)
    TextView mTvFacaipu;
    @BindView(R.id.rl_facaifu)
    RelativeLayout mRlFacaifu;
    @BindView(R.id.toolbar)
    Toolbar mToolbar;
    @BindView(R.id.title_from)
    TextView mTitleFrom;
    @BindView(R.id.fragment_content)
    TextView mFragmentContent;
    Unbinder unbinder;
    private String mFrom;

    public static FollowFragment newInstance(String from) {
        FollowFragment fragment = new FollowFragment();
        Bundle bundle = new Bundle();
        bundle.putString("from", from);
        fragment.setArguments(bundle);
        return fragment;
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            mFrom = getArguments().getString("from");
        }
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.follow_fragment_layout, null);
        unbinder = ButterKnife.bind(this, view);
        initView();
        return view;
    }

    private void initView() {
        mFragmentContent.setText("关注");
        mTvHomeFenye.setText("关注");
        mTvHomeFenye.setTextSize(22);
        mTvHomeShouye.setVisibility(View.GONE);
        mTvHomeShicai.setVisibility(View.GONE);
        mIvAdd.setVisibility(View.GONE);
        mRlFacaifu.setVisibility(View.GONE);
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }
}
